package com.education.realtime.bean;


import com.education.realtime.annotation.NotSink;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Set;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class TradeTotalOrderWindow {
    // 窗口起始时间
    String stt;

    // 窗口结束时间
    String edt;

    //累计下单人数
    Long userCount;

    @NotSink
    //user_id集合，用于统计下单人数
    Set<String> userIdSet;

    // 累计下单次数
    Long orderCount;

    // 订单 ID 集合，用于统计下单次数
    @NotSink
    Set<String> orderIdSet;

    // 累计下单金额
    Double orderAmount;

    // 时间戳
    Long ts;
}

/*
//clickhouse建表
drop table if exists dws_trade_province_order_window;
create table if not exists dws_trade_province_order_window
(
stt DateTime,
edt DateTime,
user_Count UInt64,
order_Count UInt64,
order_amount Decimal(20,5),
ts UInt64
) engine=ReplacingMergeTree(ts)
partition by toYYYYMMDD(stt)
order by (stt,edt);
 */
